package com.koala.learn.collection;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.commons.compress.utils.Sets;
import org.junit.Test;

import java.util.*;
import java.util.stream.Collectors;

/**
 * 集合框架
 *
 * @author yantingrui
 * @date 2022/7/8   9:58
 */
public class Start {

    public static void main(String[] args) {
        HashSet<Integer> set1 = Sets.newHashSet(1, 2, 3);
        HashSet<Integer> set2 = Sets.newHashSet(4, 2, 3);
        set1.retainAll(set2);
        System.out.println(set1);
    }

    /**
     * 两个集合往一个结果集填充
     */
    @Test
    public void test26() {
        HashMap<String, String> maps = Maps.newHashMap();
        ArrayList<Integer> keys = Lists.newArrayList(1, 2, 3, 4, 5, 6);
        HashMap<String, String> map1 = Maps.newHashMap();
        map1.put(String.valueOf(1), String.valueOf(1));
        map1.put(String.valueOf(1), String.valueOf(1));
        map1.put(String.valueOf(1), String.valueOf(1));
        String s = map1.get(null);
        System.out.println(s);
        HashMap<String, String> map2 = Maps.newHashMap();
    }


    /**
     *
     */
    @Test
    public void test48() {
        Person a = new Person("A", 12);
        Person b = new Person("B", 12);
        Person c = new Person("B", 12);
        List<Person> people = Arrays.asList(a, b, c);
        people.stream().collect(Collectors.toMap(Person::getName, Person::getAge));
    }

    /**
     *
     */
    @Test
    public void test59() {
        System.out.println(test69());
    }

    /**
     *
     */
    @Test
    public Long test69() {
        return null;
    }
}
